"""读取配置文件"""
from configparser import ConfigParser

class ReadIni():
    def __init__(self, file_name=None, note=None):
        if file_name == None:
            file_name = r'H:\selenium_project\config/config.ini'

        if note == None:
            self.note = 'Login'
        else:
            self.note = note

        self.cf = self.load_ini(file_name)

        
    
    # 加载文件
    def load_ini(self, file_name):
        cf = ConfigParser()
        cf.read(file_name)
        return cf

    # 获取 key
    def get_value(self, key):
        return self.cf.get(self.note, key)





